#define _CRT_SECURE_NO_WARNINGS	

#include<stdio.h>

int main()
{
    int n;
    scanf("%d", &n);
    int sum = n % 10 * 100 + n / 10 % 10 * 10 + n / 100;
    printf("%d\n", sum);
    return 0;
}